<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>OnlineTV</title>
        <link href="resources/css/index.css" rel="stylesheet" type="text/css" />
        <!--<link rel="icon" href="/icon.png" type="image/x-icon"> -->
        <!--<link rel="shortcut icon" href="./icon.png" type="image/x-icon"> -->
    </head>
    <h:body>
        <ui:include src="header.xhtml">
            <ui:param name="" value=""/>
        </ui:include>   
        <div class="wrapper">
            <table border="0">
                <tr>
                    <th scope="col" class="menu"> 
                        <ui:include src="menu.xhtml">
                            <ui:param name="" value=""/>
                        </ui:include>
                    </th>
                    <th scope="col" class="postsbk">
                        <h:form id="uploadForm" enctype="multipart/form-data">
                            <h:outputLabel value="Video Category:" style="color: white"/>
                            <h:selectOneMenu value="#{video.categoryName}">
                                <c:forEach var="VideoCategory" items="#{video.getAllVideoCategories()}">
                                    <f:selectItem  itemValue="#{VideoCategory.getCategoryName()}" />       
                                </c:forEach>
                            </h:selectOneMenu>
                            <br/>
                            <h:outputLabel for="videoName" value="Film name:" style="color: white"/>
                            <h:inputText id="videoName" value="#{video.videoName}"/>
                            <h:message for="videoName" style="color: red;" />
                            <br />
                            <h:outputLabel for="videoDescription" value="Film description:" style="color: white"/>
                            <h:inputTextarea id="videoDescription" value="#{video.videoDescription}"/>
                            <h:message for="videoDescription" style="color: red;" />

                            <h:panelGrid columns="3">
                                <h:outputLabel for="file" value="Select file" style="color: white"/>
                                <t:inputFileUpload id="file" value="#{video.uploadedFile}" required="true" />
                                <h:message for="file" style="color: red;" />

                                <h:panelGroup />
                                <h:commandButton value="Submit" action="#{video.uploadFile()}" />
                                <h:message for="uploadForm" infoStyle="color: green;" errorStyle="color: red;" />
                            </h:panelGrid>
                        </h:form>
                    </th>
                </tr>
            </table>
        </div>
        <ui:include src="footer.xhtml">
            <ui:param name="" value=""/>
        </ui:include>     
    </h:body>
</html>
